import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
import Setting from './views/Setting.vue';
import DeviceInfo from './views/DeviceInfo.vue';

import HealthManage from './views/HealthManage.vue';

import SetPosture from './views/SetPosture.vue';
import Posture from './views/Posture.vue';

Vue.use(Router);

Router.prototype.goBack = function (url) {
    this.isBack = true;
    url ? this.push(url) : this.back();
    console.hLog('goBack url', url);
};

export default new Router({
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home
        },
        {
            path: '/setting',
            name: 'Setting',
            component: Setting
        },
        {
            path: '/deviceInfo',
            name: 'DeviceInfo',
            component: DeviceInfo
        },
        // {
        //     path: '/versionInfo',
        //     name: 'VersionInfo',
        //     component: VersionInfo
        // },
        {
            path: '/HealthManage',
            name: 'HealthManage',
            component: HealthManage
        },
        {
            path: '/SetPosture',
            name: 'SetPosture',
            component: SetPosture
        },
        {
            path: '/Posture',
            name: 'Posture',
            component: Posture
        },
        // {
        //     path: '/WaistPosture',
        //     name: 'WaistPosture',
        //     component: WaistPosture
        // },
        {
            path: '/AutoWake',
            name: 'AutoWake',
            component: ()=>import("./views/AutoWake.vue")
        },
        {
            path: '/Instructions',
            name: 'Instructions',
            component: () => import('./views/Instructions.vue')
        }
    ]
});
